function TrackManager()
{
    var m_tracks = {};
    var m_ids = [];
    
    this.addTrack = function( track, trackID )
    {
        m_tracks[trackID] = track;
        m_ids.push( trackID );
        $(this).trigger('onchange', [trackID, TrackManager.STATUS_ADDED]);
    }
    
    this.clear = function()
    {
        m_tracks = {};
        m_ids = [];
        $(this).trigger('onchange', [null, null]);
    }

    this.getTrack = function(trackID)
    {
        return m_tracks[trackID];
    }
    
    //return copy of array of all track ids
    this.getAllTrackIDs = function()
    {
        return m_ids.slice(0);
    }
}

//class constants
TrackManager.STATUS_ADDED   = 1;
TrackManager.STATUS_REMOVED = 2;